# 1、在工作台中统一调用测试用例，可以实现一键执行（执行main.py文件就是执行所有的测试用例）
# 2、每一条测试脚本都写在try except语句中，避免脚本出错导致脚本停止
# 3、利用exc_info可以把报错的信息也输出出来
# 4、执行记录应该放在log.txt文件中，方便脚本执行完成之后查看结果
import sys
import os

# print('当前文件的所在目录/',os.path.dirname(__file__))
# curPath = os.path.abspath(os.path.dirname(__file__)) #获取当前文件的所在目录的绝对路径
# print('当前文件的所在目录\,',curPath)  #C:\Users\xhs\Desktop\dbshop项目相关文档2\dbshop1\main
# #将当前文件的所在目录的绝对路径进行分离,分离成C:\Users\xhs\Desktop\dbshop项目相关文档2\dbshop1  和main,存到元组中
# print(os.path.split(curPath))
# rootPath = os.path.split(curPath)[0] #[0]表示元组中的第一个元素
rootPath = os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]
print(rootPath)
sys.path.append(rootPath)  # 用python脚本将路径添加到环境变量中

from public.tools import writeLog

# 调用并且运行 DBshop001_线下支付流程
try:
    from testCase import DBshop001_线下支付流程
except:
    writeLog("DBshop001_线下支付流程 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop002_余额支付流程
except:
    writeLog("DBshop002_余额支付流程 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop003_货到付款流程
except:
    writeLog("DBshop003_货到付款流程 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop004_取消订单
except:
    writeLog("DBshop004_取消订单 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop005_订单管理查询
except:
    writeLog("DBshop005_订单管理查询 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop006_删除取消的订单
except:
    writeLog("DBshop006_删除取消的订单 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop007_销售管理发货单
except:
    writeLog("DBshop007_销售管理发货单 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop008_销售管理支付记录
except:
    writeLog("DBshop008_销售管理支付记录 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop009_销售管理退货管理搜索
except:
    writeLog("DBshop009_销售管理退货管理搜索 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop010_销售管理退货管理处理退货
except:
    writeLog("DBshop010_销售管理退货管理处理退货 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop011_商品管理管理商品添加商品
except:
    writeLog("DBshop011_商品管理管理商品添加商品 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop012_商品管理管理商品搜索商品
except:
    writeLog("DBshop012_商品管理管理商品搜索商品 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop013_商品管理管理分类商品分类分类编辑
except:
    writeLog("DBshop013_商品管理管理分类商品分类分类编辑 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop014_商品管理管理分类商品分类删除分类
except:
    writeLog("DBshop014_商品管理管理分类商品分类删除分类 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop015_商品管理管理分类前台侧边设置_添加
except:
    writeLog("DBshop015_商品管理管理分类前台侧边设置_添加 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop016_商品管理管理分类前台侧边设置_删除
except:
    writeLog("DBshop016_商品管理管理分类前台侧边设置_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop017_商品管理商品属性属性分组_添加
except:
    writeLog("DBshop017_商品管理商品属性属性分组_添加 执行出错")
    writeLog(str(sys.exc_info()[1]))


try:
    from testCase import DBshop019_商品管理商品属性属性_添加2
except:
    writeLog("DBshop019_商品管理商品属性属性_添加2 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop020_商品管理商品属性属性_删除2
except:
    writeLog("DBshop020_商品管理商品属性属性_删除2 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop018_商品管理商品属性属性分组_删除
except:
    writeLog("DBshop018_商品管理商品属性属性分组_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop021_商品管理商品品牌_添加
except:
    writeLog("DBshop021_商品管理商品品牌_添加 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop022_商品管理商品品牌_删除
except:
    writeLog("DBshop022_商品管理商品品牌_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop023_商品管理商品评价_编辑
except:
    writeLog("DBshop023_商品管理商品评价_编辑 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop024_商品管理商品评价_删除
except:
    writeLog("DBshop024_商品管理商品评价_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop025_商品管理商品咨询_回复
except:
    writeLog("DBshop025_商品管理商品咨询_回复 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop026_商品管理商品咨询_删除
except:
    writeLog("DBshop026_商品管理商品咨询_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop027_商品管理商品标签商品标签分组_新增
except:
    writeLog("DBshop027_商品管理商品标签商品标签分组_新增 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop028_商品管理商品标签商品标签分组_删除
except:
    writeLog("DBshop028_商品管理商品标签商品标签分组_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop029_商品管理商品标签普通商品标签_新增
except:
    writeLog("DBshop029_商品管理商品标签普通商品标签_新增 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop030_商品管理商品标签普通商品标签_编辑
except:
    writeLog("DBshop030_商品管理商品标签普通商品标签_编辑 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop031_商品管理商品标签特定商品标签_编辑
except:
    writeLog("DBshop031_商品管理商品标签特定商品标签_编辑 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop032_商品管理商品标签特定商品标签_删除
except:
    writeLog("DBshop032_商品管理商品标签特定商品标签_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop033_商品管理商品索引_更新
except:
    writeLog("DBshop033_商品管理商品索引_更新 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop034_客户管理管理客户_余额调整
except:
    writeLog("DBshop034_客户管理管理客户_余额调整 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop035_客户管理管理客户_积分调整
except:
    writeLog("DBshop035_客户管理管理客户_积分调整 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop036_客户管理客户扩展信息_添加
except:
    writeLog("DBshop036_客户管理客户扩展信息_添加 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop037_客户管理客户扩展信息_删除
except:
    writeLog("DBshop037_客户管理客户扩展信息_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop038_客户管理管理客户组_添加
except:
    writeLog("DBshop038_客户管理管理客户组_添加 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop039_客户管理管理客户组_删除
except:
    writeLog("DBshop039_客户管理管理客户组_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop040_客户管理客户余额充值记录_查询
except:
    writeLog("DBshop040_客户管理客户余额充值记录_查询 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop041_客户管理客户余额充值记录_删除
except:
    writeLog("DBshop041_客户管理客户余额充值记录_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop042_客户管理客户余额提现申请_搜索
except:
    writeLog("DBshop042_客户管理客户余额提现申请_搜索 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop043_客户管理客户余额提现申请_审核
except:
    writeLog("DBshop043_客户管理客户余额提现申请_审核 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop044_客户管理客户余额余额记录_搜索
except:
    writeLog("DBshop044_客户管理客户余额余额记录_搜索 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop045_客户管理管理积分积分类型_编辑
except:
    writeLog("DBshop045_客户管理管理积分积分类型_编辑 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop046_客户管理管理积分积分规则_添加
except:
    writeLog("DBshop046_客户管理管理积分积分规则_添加 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop047_客户管理管理积分积分规则_编辑
except:
    writeLog("DBshop047_客户管理管理积分积分规则_编辑 执行出错")
    writeLog(str(sys.exc_info()[1]))

try:
    from testCase import DBshop048_客户管理管理积分积分规则_删除
except:
    writeLog("DBshop048_客户管理管理积分积分规则_删除 执行出错")
    writeLog(str(sys.exc_info()[1]))
